# encoding: utf-8
# @project: st2111 
# @file: re_repetition.py.py
# @time: 2023/4/6 14:10
# @author: abcque
# @license: (C) Copyright 2013-2021
# @contact: abcque@outlook.com
# @IDE: PyCharm
# @desc:
from chapter5.regular_expression.testre.re_test_patterns import test_patterns

if __name__ == "__main__":
    text = 'abbaabbba'
    patterns = [
        ("ab*", "字符 a 后面跟着 0 个或者多个字符 b"),
        ("ab+", "字符 a 后面跟着 1 个或者多个字符 b"),
        ("ab?", "字符 a 后面跟着 0 个或者 1 个字符 b"),
        ("ab{3}", "字符 a 后面跟着 3 个字符 b"),
        ("ab{2,3}", "字符 a 后面跟着 2 个或者 3 个字符 b"),
        ("ab{2,}", "字符 a 后面跟着 2 个或者多个字符 b"),
        ("ab{,3}", "字符 a 后面跟着 0 个到 3 个字符 b"),
    ]
    test_patterns(text=text, patterns=patterns)
